package com.iphanta.community.following.web.admin;

import com.iphanta.community.common.entity.DataResult;
import com.iphanta.community.common.utils.ResultUtils;
import com.iphanta.community.following.service.AdminDynamicService;
import com.iphanta.community.following.traffic.admin.AdminQueryDynamicRequest;
import com.iphanta.community.following.traffic.admin.AdminQueryDynamicResponse;
import com.iphanta.community.following.traffic.admin.AdminModifyDynamicTagRequest;
import com.iphanta.community.following.traffic.admin.AdminModifyDynamicTagResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 后台-动态管理
 *
 * @author 墨声 E-mail: zehong.hongframe.huang@gmail.com
 * create time: 4/22/22 2:38 PM
 */
@RestController
@RequestMapping("community/admin/dynamic/")
public class AdminDynamicController {

    @Autowired
    private AdminDynamicService adminDynamicService;

    /**
     * 动态页列表
     *
     * @param request
     * @return
     */
    @PostMapping("query")
    public DataResult<AdminQueryDynamicResponse> query(@RequestBody AdminQueryDynamicRequest request) {
        return ResultUtils.SUCCESS.result(adminDynamicService.query(request));
    }

    /**
     * 修改动态标签
     *
     * @param request
     * @return
     */
    @PostMapping("modify")
    public DataResult<AdminModifyDynamicTagResponse> modifyDynamicTags(@RequestBody AdminModifyDynamicTagRequest request) {
        return ResultUtils.SUCCESS.result(adminDynamicService.modify(request));
    }

}
